/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entities;

import java.io.Serializable;
import javax.persistence.*;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Cyn
 */
@Entity
@XmlRootElement
@NamedQueries({
    @NamedQuery(name="TypeCompte.findAll", query="select t from TypeCompte t"),
    @NamedQuery(name="TypeCompte.findById", query="select tc from TypeCompte tc where tc.id = :typeid"),
    @NamedQuery(name="TypeCompte.findByLibelle", query="select tc from TypeCompte tc where tc.libelleType = :lib")
})
public class TypeCompte implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;
    private String libelleType;

    public TypeCompte(String libelleType) {
        this.libelleType = libelleType;
    }

    public TypeCompte() {
    }
    
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getLibelleType() {
        return libelleType;
    }

    public void setLibelleType(String libelleType) {
        this.libelleType = libelleType;
    }
    
    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TypeCompte)) {
            return false;
        }
        TypeCompte other = (TypeCompte) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entities.TypeCompte[ id=" + id + " ]";
    }
    
}
